package com.bba.manager.user.controller;

import com.bba.manager.common.model.user.Employee;
import com.bba.manager.common.util.ResponseVO;
import com.bba.manager.user.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author SYANDZZY
 * @since 2025-08-11
 */
@RestController
@RequestMapping("/employee")
public class EmployeeController {

    @Autowired
    private IEmployeeService employeeService;
/**
 * 注册
 */
  @PostMapping("/register")
   public ResponseVO register(@RequestBody Employee employee){
      employeeService.register(employee);
      return ResponseVO.success(employee);
  }

    /**
     * 修改销售信息
     * @return
     */
    @PostMapping("/update")
    public ResponseVO update(@RequestBody Employee employee){
        employeeService.updateById(employee);
        return ResponseVO.success(employee);
    }

  @GetMapping("/test")
    public ResponseVO test(){
      return ResponseVO.success();
  }

}
